class Article < ActiveRecord::Base
  THUMB_IMAGE_SIZE = "80"
  file_column :image_url, :magick => {
    :versions => { "thumb" => THUMB_IMAGE_SIZE}
  }

  TYPE = [
    [ "首页",      1 ],
    [ "左则广告",   2 ],
    [ "右则广告",   3 ]
  ]

  def self.index_news(count,type)
    articles = Article.find(:all,:conditions=>["article_type = ?",type],
      :order=>'top',
      :limit=>count)
    articles
  end
end
